var oldObjArrayCheckin = new Array();
var setRowObjArrayCheckin = new Array();
//////////////Start CheckInPending Page ////////////////
function searchAll_checkinPendingPage(value,e){
	/*if (e.keyCode == 13 && !e.ctrlKey) {
		getReservationRoomCheckinPendingManageMent("textSearch",value);
		$("#SearchAll_checkinpendingPage").val("");
	}*/
}
function getReservationRoomCheckinPendingManageMent(data,valueSearch){
	clearData();
	waitingDialog({});
	var searchName = $("#SearchAll_checkinpendingPage").val();
	if($("#RowpagerCheckInPendingListRoomManageMent").val() == null){
		getCurrentTabData().linePendingCheckin = 10;
	}else{
		getCurrentTabData().linePendingCheckin = $("#RowpagerCheckInPendingListRoomManageMent").val();
	}
	if($("#pagerCheckInPendingListRoomManageMent").val() == null){
		var pagePointer = 1; 
	}else{
		if(valueSearch!=""&&valueSearch!=undefined){
			var pagePointer = valueSearch; 
		}else{
			var pagePointer = 1;
			getCurrentTabData().pagerNumber = 1;
		}
		//var pagePointer = $("#pagerCheckInPendingListRoomManageMent").val(); 
	}
	var dataOld =  $("#typeCheckReservationPendingCheckin").val();
	var offfset = (getCurrentTabData().linePendingCheckin*pagePointer)-getCurrentTabData().linePendingCheckin;
	var valueDateCheckin = $("#calendar_btw_checkinPendingCheckin").attr("dateofBtwCheckinPendingCheckin");
	var valueDateCheckout = $("#calendar_btw_checkoutPendingCheckin").attr("dateofBtwCheckoutPendingCheckin");
	if(valueDateCheckin!=""&&valueDateCheckout!=""){
		var dateCheckin = $("#calendar_btw_checkinPendingCheckin").attr("dateofBtwCheckinPendingCheckin");
	  	var dateCheckout = $("#calendar_btw_checkoutPendingCheckin").attr("dateofBtwCheckoutPendingCheckin");
	  	$("#calendar_btw_checkinPendingCheckin").val($.datepicker.parseDate("yy-mm-dd",dateCheckin).getFormatedString());
		$("#calendar_btw_checkoutPendingCheckin").val($.datepicker.parseDate("yy-mm-dd",dateCheckout).getFormatedString());
		$('#calendar_btw_checkinPendingCheckin').attr('dateofBtwCheckinPendingCheckin',dateCheckin);
		$('#calendar_btw_checkoutPendingCheckin').attr('dateofBtwCheckoutPendingCheckin',dateCheckout);
		getCurrentTabData().valueDateCheckin = dateCheckin;
		getCurrentTabData().valueDateCheckout = dateCheckout;
	}else{
		var dateCheckin = new Date().toFormatString("yyyy-MM-dd");
		var dateCheckout= new Date().toFormatString("yyyy-MM-dd");
		$("#calendar_btw_checkinPendingCheckin").val($.datepicker.parseDate("yy-mm-dd",dateCheckin).getFormatedString());
		$("#calendar_btw_checkoutPendingCheckin").val($.datepicker.parseDate("yy-mm-dd",dateCheckout).getFormatedString());
		$('#calendar_btw_checkinPendingCheckin').attr('dateofBtwCheckinPendingCheckin',dateCheckin);
		$('#calendar_btw_checkoutPendingCheckin').attr('dateofBtwCheckoutPendingCheckin',dateCheckout);
		getCurrentTabData().valueDateCheckin = dateCheckin;
		getCurrentTabData().valueDateCheckout = dateCheckout;
	}
	if(data=="CheckInPendingListRoomManageMent"){
		if(pagePointer>1){
			var link = "/reservationService?func=getReservationAllCheckinPendingOnly&offset="
				+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+(pagePointer-1)+"&SearchAll_checkoutPage="+searchName;
			var linkSet = "/reservationService?func=getReservationAllCheckinPendingOnly&offset="
				+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&SearchAll_checkoutPage="+searchName;
			getCurrentTabData().linkSet = linkSet;
			simpleservice(link,null,showDataResRoomManageMentSetCountPendingCheckin,getCurrentTabData().linePendingCheckin);
		}else{
			getCurrentTabData().beforePagePendingCheckin = ""; 
			getCurrentTabData().beforeSubPagePendingCheckin = "";
			var link = "/reservationService?func=getReservationAllCheckinPendingOnly&offset="
				+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&SearchAll_checkoutPage="+searchName;
			simpleservice(link,null,showDataResRoomCheckinPendingManageMent,data);
		}
		/*var link = "/reservationService?func=getReservationAllCheckinPendingOnly";
		simpleservice(link,null,showDataResRoomCheckinPendingManageMent,data);*/
	}else if(data=="G"){
		getCurrentTabData().typeReservationPendingCheckin = data;
		typeReservationPendingCheckinFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data)
		//showDataResRoomCheckinPendingManageMent(data,"G");
	}else if(data=="S"){
		getCurrentTabData().typeReservationPendingCheckin = data;
		typeReservationPendingCheckinFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data)
		//showDataResRoomCheckinPendingManageMent(data,"S");
	}else if(data=="A"){
		getCurrentTabData().typeReservationPendingCheckin = data;
		typeReservationPendingCheckinFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data)
		//showDataResRoomCheckinPendingManageMent(data,"A");
	}else if(data == "textSearch"){
		showDataResRoomCheckinPendingManageMent(data,"textSearch");
	}else if(data == "dateSearch"){
		var dataOld =  $("#typeCheckReservationPendingCheckin").val();
		var valueDateCheckin = $("#calendar_btw_checkinPendingCheckin").attr("dateofBtwCheckinPendingCheckin");
		var valueDateCheckout = $("#calendar_btw_checkoutPendingCheckin").attr("dateofBtwCheckoutPendingCheckin");
		getCurrentTabData().checkinPendingCheckin = valueDateCheckin;
		getCurrentTabData().checkinPendingCheckout = valueDateCheckout;
		if(valueDateCheckin!=""&&valueDateCheckout!=""){
			var dateCheckin = $("#calendar_btw_checkinPendingCheckin").attr("dateofBtwCheckinPendingCheckin");
			getCurrentTabData().valueDateCheckin = valueDateCheckin;
			var dateCheckout= $("#calendar_btw_checkoutPendingCheckin").attr("dateofBtwCheckoutPendingCheckin");
			if(dataOld=="G"){
				getCurrentTabData().typeReservationPendingCheckin = dataOld;
				if(pagePointer>1){
					var link = "/reservationService?func=getReservationAllCheckinPendingOnlyGroup&offset="
						+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					var linkSet = "/reservationService?func=getReservationAllCheckinPendingOnlyGroup&offset="
						+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					getCurrentTabData().linkSet = linkSet;
					simpleservice(link,null,showDataResRoomManageMentSetCountPendingCheckin,getCurrentTabData().linePendingCheckin);
				}else{
					getCurrentTabData().beforePagePendingCheckin = ""; 
					getCurrentTabData().beforeSubPagePendingCheckin = "";
					var link = "/reservationService?func=getReservationAllCheckinPendingOnlyGroup&offset="
						+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					simpleservice(link,null,showDataResRoomCheckinPendingManageMent,data);
				}
				//var link = "/reservationService?func=getReservationAllCheckinPendingOnlyGroup&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
				//simpleservice(link,null,showDataResRoomCheckinPendingManageMent,data);
			}else if(dataOld=="S"){
				getCurrentTabData().typeReservationPendingCheckin = dataOld;
				if(pagePointer>1){
					var link = "/reservationService?func=getReservationAllCheckinPendingOnlySingle&offset="
						+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					var linkSet = "/reservationService?func=getReservationAllCheckinPendingOnlySingle&offset="
						+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					getCurrentTabData().linkSet = linkSet;
					simpleservice(link,null,showDataResRoomManageMentSetCountPendingCheckin,getCurrentTabData().linePendingCheckin);
				}else{
					getCurrentTabData().beforePagePendingCheckin = ""; 
					getCurrentTabData().beforeSubPagePendingCheckin = "";
					var link = "/reservationService?func=getReservationAllCheckinPendingOnlySingle&offset="
						+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					simpleservice(link,null,showDataResRoomCheckinPendingManageMent,data);
				}
				//var link = "/reservationService?func=getReservationAllCheckinPendingOnlySingle&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
				//simpleservice(link,null,showDataResRoomCheckinPendingManageMent,data);
			}else if(dataOld=="A"){
				getCurrentTabData().typeReservationPendingCheckin = dataOld;
				if(pagePointer>1){
					var link = "/reservationService?func=getReservationAllCheckinPendingOnly&offset="
						+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					var linkSet = "/reservationService?func=getReservationAllCheckinPendingOnly&offset="
						+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					getCurrentTabData().linkSet = linkSet;
					simpleservice(link,null,showDataResRoomManageMentSetCountPendingCheckin,getCurrentTabData().linePendingCheckin);
				}else{
					getCurrentTabData().beforePagePendingCheckin = ""; 
					getCurrentTabData().beforeSubPagePendingCheckin = "";
					var link = "/reservationService?func=getReservationAllCheckinPendingOnly&offset="
						+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout+"&SearchAll_checkoutPage="+searchName;
					simpleservice(link,null,showDataResRoomCheckinPendingManageMent,data);
				}
				//var link = "/reservationService?func=getReservationAllCheckinPendingOnly&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
				//simpleservice(link,null,showDataResRoomCheckinPendingManageMent,data);
			}
		}else{
			$("#calendar_btw_checkinAll").select();
		}
	}
}

function showDataResRoomCheckinPendingManageMent(data,output){
	var valueDateCheckin = getCurrentTabData().valueDateCheckin;
	var valueDateCheckout = getCurrentTabData().valueDateCheckout;
	if(valueDateCheckin!=""&&valueDateCheckout!=""){
		var dateCheckin = valueDateCheckin;
	  	var dateCheckout = valueDateCheckout;
	  	$("#calendar_btw_checkinPendingCheckin").val($.datepicker.parseDate("yy-mm-dd",dateCheckin).getFormatedString());
		$("#calendar_btw_checkoutPendingCheckin").val($.datepicker.parseDate("yy-mm-dd",dateCheckout).getFormatedString());
		$('#calendar_btw_checkinPendingCheckin').attr('dateofBtwCheckinPendingCheckin',dateCheckin);
		$('#calendar_btw_checkoutPendingCheckin').attr('dateofBtwCheckoutPendingCheckin',dateCheckout);
	}
	// set for pager
	getCurrentTabData().tablePager = "tablepagingPendingCheckin";
	getCurrentTabData().pagerNumberField = "pagerCheckInPendingListRoomManageMent";
	getCurrentTabData().functionGetData = "getReservationRoomCheckinPendingManageMent";
	getCurrentTabData().pageName = "CheckInPendingListRoomManageMent";
	getCurrentTabData().pageNavPosition = "pageNavPositionPendingCheckin";
	getCurrentTabData().trCheck = "trPendingcheckin";
	if(getCurrentTabData().checkinPendingCheckin!=undefined){
		$('#calendar_btw_checkinPendingCheckin').val($.datepicker.parseDate("yy-mm-dd",getCurrentTabData().checkinPendingCheckin).getFormatedString());
		$('#calendar_btw_checkinPendingCheckin').attr('dateofBtwCheckinPendingCheckin',getCurrentTabData().checkinPendingCheckin);
	}
	if(getCurrentTabData().checkinPendingCheckout!=undefined){
		$('#calendar_btw_checkoutPendingCheckin').val($.datepicker.parseDate("yy-mm-dd",getCurrentTabData().checkinPendingCheckout).getFormatedString());
		$('#calendar_btw_checkoutPendingCheckin').attr('dateofBtwCheckoutPendingCheckin',getCurrentTabData().checkinPendingCheckout);
	}
	if(getCurrentTabData().typeReservationPendingCheckin!=undefined){
		$('#typeCheckReservationPendingCheckin option[value='+getCurrentTabData().typeReservationPendingCheckin+']').attr('selected', 'selected');
	}
	if(data.trim()=="[]"){
		var textDataEmpty = '<tr clearTr="checkinpendingReservation" >'+
		'<td colspan="100%" style="text-align:center;" >'+
		dataEmpty+
		'</td>'+
		'</tr>';
		textRoomCheckInPending = textDataEmpty;
		$("[clearTr=checkinpendingReservation]").remove();
		$("#CheckInListPendingRoomManageMent_Id_Tr").replaceWith("<tr id=CheckInListPendingRoomManageMent_Id_Tr ></tr>"+textRoomCheckInPending);
		textRoomCheckInPending = '';
	}else{
		$("[clearTr=checkinpendingReservation]").remove();
		var objArray = new Array();
		if((data=="textSearch"||data=="G"||data=="S"||data=="A"||data=="reservationType_A"||data=="Checked-out Rooms"||data=="Checked-in Rooms")&&data!="dateSearch"){
			objArray = oldObjArrayCheckin;
			objArray = objArray[0];
		}else{
			objArray = JSON.parse(data);
			oldObjArrayCheckin = objArray;
			objArray = objArray[0];
		}
		var numberSet = getCurrentTabData().beforePagePendingCheckin; 
		var numberSubSet = getCurrentTabData().beforeSubPagePendingCheckin;
		setRowObjArrayCheckin = objArray;
		sortIdRoommanagement(objArray);
		textRoomCheckInPendingPrint = '';
		var checkBgColor = 0;
		var countGroup = 0;
		var OldGroupId =0;
		var valueSearch = $("#SearchAll_checkinpendingPage").val();
		var firstSelect = "";
		var typeReservation = $("#typeCheckReservationPendingCheckin").val();
		var emailPic = '<img src=../images/components/roommanagement/email.png alt=Note height=15 width=20>';
		var printPci = '<img src=../images/components/roommanagement/print.png alt=Note height=15 width=20>';
		for(var i =0;i<objArray.length;i++){
			if(objArray[i].name!=""&&objArray[i].name!=undefined){
				var nameReservation = objArray[i].name.split(" ");
			}else{
				var nameReservation = "";
			}
			var Objtitle = objArray[i].reservationTitle;
			var ObjgroupId = objArray[i].groupId;
			var ObjId = objArray[i].id;
			var checkContinue = checkedFilter(output,valueSearch,nameReservation,firstSelect,Objtitle,ObjgroupId,typeReservation,ObjId);
			if(checkContinue==1){
				continue;
			}
			if(objArray[i].groupId!="0"){
				if(objArray[i].subList!=undefined){
					var setDateFormat = new Date(objArray[i].date);
					var setYear = setDateFormat.getFullYear();
					var setMonth = setDateFormat.getMonth()+1;
					var setDay = setDateFormat.getDate();
					var DateFormatThai = setYear+'-'+setMonth+'-'+setDay;
					var setFateFormatCheckout = setDateFormat.addDate(parseInt(objArray[i].span));
					var setYearCheckOut = setFateFormatCheckout.getFullYear();
					var setMonthCheckOut = setFateFormatCheckout.getMonth()+1;
					var setDayCheckOut = setFateFormatCheckout.getDate();
					var DateformatThaiCheckout = setYearCheckOut+'-'+setMonthCheckOut+'-'+setDayCheckOut;
					groupId = objArray[i].groupIdString;
						var splitResIdInGroup = objArray[i].resList.split(",");
						var textSubRes = "";
						var textSubResPrint = "";
						var checkBgColorG =0;
						var StatusResInGroup = "";
						var statusRecord = "";
						for(var subRes = 0;subRes<objArray[i].subList.length;subRes++){
							var DescriptionSubRes = "";
							if(objArray[i].subList[subRes].description!=undefined&&objArray[i].subList[subRes].description!=""){
								DescriptionSubRes = objArray[i].subList[subRes].description;
							}else{
								DescriptionSubRes = "";
							}
							var setDateFormatRes = new Date(objArray[i].subList[subRes].date);
							var setYearRes = setDateFormatRes.getFullYear();
							var setMonthRes = setDateFormatRes.getMonth();
							var setDayRes = setDateFormatRes.getDate();
							var DateFormatThaiRes = setYearRes+'-'+setMonthRes+'-'+setDayRes;
							var setFateFormatCheckoutRes = setDateFormatRes.addDate(parseInt(objArray[i].subList[subRes].span));
							var setYearCheckOutRes = setFateFormatCheckoutRes.getFullYear();
							var setMonthCheckOutRes = setFateFormatCheckoutRes.getMonth();
							var setDayCheckOutRes = setFateFormatCheckoutRes.getDate();
							var DateformatThaiCheckoutRes = setYearCheckOutRes+'-'+setMonthCheckOutRes+'-'+setDayCheckOutRes;
							var ShowNameGuest = "";
							/// Name Empty
							if(objArray[i].subList[subRes].name!=undefined){
								ShowNameGuest = objArray[i].subList[subRes].name
							}
							///
							if(objArray[i].subList[subRes].reservationTitle=="Reserved Rooms"){
								StatusResInGroup = statusResv;
							}else if(objArray[i].subList[subRes].reservationTitle=="Checked-out Rooms"){
								StatusResInGroup = statusCheckOut;
							}else if(objArray[i].subList[subRes].reservationTitle=="Temp Rooms"){
								StatusResInGroup = statusTempResv;
							}else if(objArray[i].subList[subRes].reservationTitle=="Cancel Reservation"){
								StatusResInGroup = statusCancel;
							}else{
								StatusResInGroup = statusCheckin;
							}
							if(checkBgColorG==0){
								statusRecord = 'dataRecordBot';
								checkBgColorG = 1;
							}else{
								statusRecord = 'dataRecordBot';
								checkBgColorG =0;
							}
							var displayNameGuest = "";
							if(ShowNameGuest!=""){
								displayNameGuest = '<tr clearTr=checkinpendingReservation class="'+statusRecord+'" onclick="if(linkClick==true){CallEditReservedPageWithLoadElement(id,'+objArray[i].subList[subRes].id+')}"  id="btnEditS" >';
							}else{
								displayNameGuest = '<tr clearTr=checkinpendingReservation class="'+statusRecord+'" onclick="if(linkClick==true)noGuestName();"  id="btnEditS" >';
							}
							var runnumberSub = "";
							if(getCurrentTabData().beforePagePendingCheckin!=undefined&&getCurrentTabData().beforePagePendingCheckin!=""){
								runnumberSub = (numberSet+1)+"."+(subRes+1);
							}else{
								runnumberSub = (i+1)+"."+(subRes+1);
							}
							var obj = objArray[i].subList[subRes];
							for (var k in obj){ if (obj.hasOwnProperty(k)){obj[k] = String(obj[k]);}} //object to string
							objArray[i].subList[subRes] = obj;
							var re2 = /"/gi;
							var sendData = JSON.stringify(objArray[i].subList[subRes]).replace(re2, "'");
							
								textSubRes += displayNameGuest+
								'<td colspan="2" class="spanDataCenter">'+
								runnumberSub+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span>'+objArray[i].subList[subRes].id+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span class="guestName" >'+ShowNameGuest+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' ('+objArray[i].subList[subRes].span+')</span>'+
								'</td>'+
								'<td class="spanDataCenter"> '+
									'<span>'+objArray[i].subList[subRes].roomTypeName+'('+objArray[i].subList[subRes].roomName+')'+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span>'+adult+'('+objArray[i].subList[subRes].adult+') - '+child+'('+objArray[i].subList[subRes].child+')'+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									StatusResInGroup+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>'+toCurrencyString(currencyStringToNumber(objArray[i].subList[subRes].defaultCherge))+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<div onmouseover="linkClick=false;" onmouseout="linkClick=true;" >'+
									'<span  onclick="printRoomManagementSinggle('+sendData+')" >'+printPci+'</span>'+
								'<span id="sendMail'+objArray[i].subList[subRes].id+'" onclick="sendMail(id)"> '+emailPic+'</span></div>'+
								'</td>'+
								'</tr>';
								textSubResPrint += '<tr clearTr=checkinpendingReservation class="'+statusRecord+'" onclick="if(linkClick&&ShowNameGuest!="") CallEditReservedPageWithLoadElement(id,'+objArray[i].subList[subRes].id+')"  id="btnEditS" >'+
								'<td colspan="2" class="spanDataCenter">'+
								runnumberSub+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span>'+objArray[i].subList[subRes].id+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span class="guestName" >'+ShowNameGuest+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' ('+objArray[i].subList[subRes].span+')</span>'+
								'</td>'+
								'<td class="spanDataCenter"> '+
									'<span>'+objArray[i].subList[subRes].roomTypeName+'('+objArray[i].subList[subRes].roomName+')'+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">' +
									'<span>'+adult+'('+objArray[i].subList[subRes].adult+') - '+child+'('+objArray[i].subList[subRes].child+')'+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									StatusResInGroup+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span>'+toCurrencyString(currencyStringToNumber(objArray[i].subList[subRes].defaultCherge))+'</span>'+
								'</td>'+
								'<td class="spanDataCenter">'+
									'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
								'</td>'+
								'</tr>';
						}
						///Check StatusGroup
						var obj = objArray[i].subList;
						showStatusResInGroup = checkStatusReservationGroup(obj);
						///
						var dateFormatDisplay = setDateFormat.getFormatedString();
						var obj = objArray[i];
						var  checksub = 0;
						for (var k in obj)
						{
						    if(obj.subList!=undefined && checksub == 0){
						    	checksub = 1;
						    	var newsubListObjString = new Array();
						    	for(var sublistGroup=0;sublistGroup<obj.subList.length;sublistGroup++){
						    		var objsub = obj.subList[sublistGroup];
						    		for (var j in objsub)
									{
							    		if (objsub.hasOwnProperty(j))
									    {
											objsub[j] = String(objsub[j]);
											
									    }
									}
						    		newsubListObjString.push(objsub);
						    	}
						    	obj.subList = newsubListObjString;
						    }
							if (obj.hasOwnProperty(k))
						    {
						        if(k=="subList")
						        	continue;
								obj[k] = String(obj[k]);
						    }
						}
						objArray[i] = obj;
						var re2 = /"/gi;
						var sendDataGroup = JSON.stringify(objArray[i]).replace(re2, "'");
						if(getCurrentTabData().beforePagePendingCheckin!=undefined&&getCurrentTabData().beforePagePendingCheckin!=""){
							numberSet = numberSet+1;
							number = numberSet;
						}else{
							number = (i+1);
						}
						textRoomCheckInPending += '<tr clearTr=checkinpendingReservation class="dataRecordGroup" onclick="if(linkClick) CallEditReservedPageWithLoadElement(id,'+objArray[i].groupIdString+')"  id="btnEditG"  >'+
						'<td class="spanDataMagin">'+
						number+'('+objArray[i].resList.split(",").length+')'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>G'+objArray[i].groupIdString+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span></span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span class="ownerName" >'+objArray[i].name+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+dateFormatDisplay+'-'+setFateFormatCheckout.getFormatedString()+' ('+objArray[i].span+')</span>'+
						'</td>'+
						'<td class="spanDataCenter"> '+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span></span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
						'<span>'+showStatusResInGroup+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span></span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span><div class="fongwordwarp" >'+objArray[i].description+'</div></span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<div onmouseover="linkClick=false;" onmouseout="linkClick=true;" >'+
							'<span  onclick="printRoomManagementSinggle('+sendDataGroup+')" >'+printPci+'</span>'+
						'<span id="sendMail'+objArray[i].groupIdString+'" onclick="sendMail(id)"> '+emailPic+'</span></div>'+
						'</td>'+
					'</tr>'+textSubRes;
						
						textRoomCheckInPendingPrint += '<tr clearTr=checkinpendingReservation class="dataRecordGroup" onclick="if(linkClick) CallEditReservedPageWithLoadElement(id,'+objArray[i].groupIdString+')"  id="btnEditG"  >'+
						'<td class="spanDataMagin">'+
						number+'('+objArray[i].resList.split(",").length+')'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>G'+objArray[i].groupIdString+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span></span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span class="ownerName" >'+objArray[i].name+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+dateFormatDisplay+'-'+setFateFormatCheckout.getFormatedString()+' ('+objArray[i].span+')</span>'+
						'</td>'+
						'<td class="spanDataCenter"> '+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span></span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
						'<span></span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span></span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span><div class="fongwordwarp" >'+objArray[i].description+'</div></span>'+
						'</td>'+
					'</tr>'+textSubResPrint;
				}else{
					var DescriptionSubRes = "";
					if(objArray[i].description!=undefined&&objArray[i].description!=""){
						DescriptionSubRes = objArray[i].description;
					}else{
						DescriptionSubRes = "";
					}
					var setDateFormatRes = new Date(objArray[i].date);
					var setYearRes = setDateFormatRes.getFullYear();
					var setMonthRes = setDateFormatRes.getMonth();
					var setDayRes = setDateFormatRes.getDate();
					var DateFormatThaiRes = setYearRes+'-'+setMonthRes+'-'+setDayRes;
					var setFateFormatCheckoutRes = setDateFormatRes.addDate(parseInt(objArray[i].span));
					var setYearCheckOutRes = setFateFormatCheckoutRes.getFullYear();
					var setMonthCheckOutRes = setFateFormatCheckoutRes.getMonth();
					var setDayCheckOutRes = setFateFormatCheckoutRes.getDate();
					var DateformatThaiCheckoutRes = setYearCheckOutRes+'-'+setMonthCheckOutRes+'-'+setDayCheckOutRes;
					var ShowNameGuest = "";
					/// Name Empty
					if(objArray[i].name!=undefined){
						ShowNameGuest = objArray[i].name
					}
					///
					if(objArray[i].reservationTitle=="Reserved Rooms"){
						StatusResInGroup = statusResv;
					}else if(objArray[i].reservationTitle=="Checked-out Rooms"){
						StatusResInGroup = statusCheckOut;
					}else if(objArray[i].reservationTitle=="Temp Rooms"){
						StatusResInGroup = statusTempResv;
					}else if(objArray[i].reservationTitle=="Cancel Reservation"){
						StatusResInGroup = statusCancel;
					}else{
						StatusResInGroup = statusCheckin;
					}
					if(checkBgColorG==0){
						statusRecord = 'dataRecordBot';
						checkBgColorG = 1;
					}else{
						statusRecord = 'dataRecordBot';
						checkBgColorG =0;
					}
					var displayNameGuest = "";
					if(ShowNameGuest!=""){
						displayNameGuest = '<tr clearTr=checkinpendingReservation class="'+statusRecord+'" onclick="if(linkClick==true){CallEditReservedPageWithLoadElement(id,'+objArray[i].id+')}"  id="btnEditS" >';
					}else{
						displayNameGuest = '<tr clearTr=checkinpendingReservation class="'+statusRecord+'"   id="btnEditS" >';
					}
					var obj = objArray[i];
					for (var k in obj){ if (obj.hasOwnProperty(k)){obj[k] = String(obj[k]);}} //object to string
					objArray[i] = obj;
					var re2 = /"/gi;
					var sendData = JSON.stringify(objArray[i]).replace(re2, "'");
					var runnumberSub = "";
					if(getCurrentTabData().beforePagePendingCheckin!=undefined&&getCurrentTabData().beforePagePendingCheckin!=""){
						runnumberSub = (numberSet)+"."+(numberSubSet);
						numberSubSet = numberSubSet+1;
					}else{
						runnumberSub = (i+1)+"."+(subRes+1);
					}
					textRoomCheckInPending += displayNameGuest+
						'<td colspan="2" class="spanDataCenter">'+
						runnumberSub+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+objArray[i].id+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span class="guestName" >'+ShowNameGuest+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' ('+objArray[i].span+')</span>'+
						'</td>'+
						'<td class="spanDataCenter"> '+
							'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							StatusResInGroup+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+toCurrencyString(currencyStringToNumber(objArray[i].defaultCherge))+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<div onmouseover="linkClick=false;" onmouseout="linkClick=true;" >'+
							'<span  onclick="printRoomManagementSinggle('+sendData+')" >'+printPci+'</span>'+
						'<span id="sendMail'+objArray[i].id+'" onclick="sendMail(id)"> '+emailPic+'</span></div>'+
						'</td>'+
						'</tr>';
					textRoomCheckInPendingPrint += '<tr clearTr=checkinpendingReservation class="'+statusRecord+'" onclick="if(linkClick&&ShowNameGuest!="") CallEditReservedPageWithLoadElement(id,'+objArray[i].id+')"  id="btnEditS" >'+
						'<td colspan="2" class="spanDataCenter">'+
						runnumberSub+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+objArray[i].id+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span class="guestName" >'+ShowNameGuest+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+setDateFormatRes.getFormatedString()+'-'+setFateFormatCheckoutRes.getFormatedString()+' ('+objArray[i].span+')</span>'+
						'</td>'+
						'<td class="spanDataCenter"> '+
							'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							StatusResInGroup+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+toCurrencyString(currencyStringToNumber(objArray[i].defaultCherge))+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span><div class="fongwordwarp" >'+DescriptionSubRes+'</div></span>'+
						'</td>'+
						'</tr>';
				}
			}else{
				res = objArray[i].id;
				var setDateFormat = new Date(objArray[i].date);
				var setYear = setDateFormat.getFullYear();
				var setMonth = setDateFormat.getMonth()+1;
				var setDay = setDateFormat.getDate();
				var DateFormatThai = setYear+'-'+setMonth+'-'+setDay;
				var setFateFormatCheckout = setDateFormat.addDate(parseInt(objArray[i].span));
				var setYearCheckOut = setFateFormatCheckout.getFullYear();
				var setMonthCheckOut = setFateFormatCheckout.getMonth()+1;
				var setDayCheckOut = setFateFormatCheckout.getDate();
				var DateformatThaiCheckout = setYearCheckOut+'-'+setMonthCheckOut+'-'+setDayCheckOut;
				getStatusResInGroup = objArray[i].reservationTitle;
				if(getStatusResInGroup=="Reserved Rooms"){
					showStatusResInGroup = statusResv;
				}else if(getStatusResInGroup=="Checked-out Rooms"){
					showStatusResInGroup = statusCheckOut;
				}else if(getStatusResInGroup=="Temp Rooms"){
					showStatusResInGroup = statusTempResv;
				}else if(getStatusResInGroup=="Cancel Reservation"){
					showStatusResInGroup = statusCancelCheckin;
				}else{
					showStatusResInGroup = statusCheckin;
				}
				if(checkBgColor==0){
					statusRecord = 'dataRecordBot';
					checkBgColor = 1;
				}else{
					statusRecord = 'dataRecordBot';
					checkBgColor =0;
				}
				var obj = objArray[i];
				for (var k in obj)
				{
				    if (obj.hasOwnProperty(k))
				    {
				        obj[k] = String(obj[k]);
				    }
				}
				objArray[i] = obj;
				var re2 = /"/gi;
				if(getCurrentTabData().beforePagePendingCheckin!=undefined&&getCurrentTabData().beforePagePendingCheckin!=""){
					numberSet = numberSet+1;
					number = numberSet;
				}else{
					number = (i+1);
				}
				var sendData = JSON.stringify(objArray[i]).replace(re2, "'");
				if(setDateFormat.getFormatedString()!=undefined){
						textRoomCheckInPending += '<tr clearTr=checkinpendingReservation class="'+statusRecord+'" onclick="if(linkClick){ CallEditReservedPageWithLoadElement(id,'+objArray[i].id+')}" id="btnEditS">'+
						'<td class="spanDataMagin" >'+
						number+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span></span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+objArray[i].id+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span class="guestName" >'+objArray[i].name+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+setDateFormat.getFormatedString()+'-'+setFateFormatCheckout.getFormatedString()+' ('+objArray[i].span+')</span>'+
						'</td>'+
						'<td class="spanDataCenter"> '+
							'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
						'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+showStatusResInGroup+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+toCurrencyString(currencyStringToNumber(objArray[i].defaultCherge))+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
						'<span><div class="fongwordwarp" >'+objArray[i].description+'</div></span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<div onmouseover="linkClick=false;" onmouseout="linkClick=true;" >'+
								'<span  onclick="printRoomManagementSinggle('+sendData+')" >'+printPci+'</span>'+
								'<span id="sendMail'+objArray[i].id+'" onclick="sendMail(id)"> '+emailPic+'</span>'+
							'</div>'+
						'</td>'+
					'</tr>';
						textRoomCheckInPendingPrint += '<tr clearTr=checkinpendingReservation class="'+statusRecord+'" onclick="if(linkClick){ CallEditReservedPageWithLoadElement(id,'+objArray[i].id+')}" id="btnEditS">'+
						'<td class="spanDataMagin" >'+
						number+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span></span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
							'<span>'+objArray[i].id+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span class="guestName" >'+objArray[i].name+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+setDateFormat.getFormatedString()+'-'+setFateFormatCheckout.getFormatedString()+' ('+objArray[i].span+')</span>'+
						'</td>'+
						'<td class="spanDataCenter"> '+
							'<span>'+objArray[i].roomTypeName+'('+objArray[i].roomName+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">' +
						'<span>'+adult+'('+objArray[i].adult+') - '+child+'('+objArray[i].child+')'+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+showStatusResInGroup+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
							'<span>'+toCurrencyString(currencyStringToNumber(objArray[i].defaultCherge))+'</span>'+
						'</td>'+
						'<td class="spanDataCenter">'+
						'<span><div class="fongwordwarp" >'+objArray[i].description+'</div></span>'+
						'</td>'+
					'</tr>';
				}
			}
		}
		if(textRoomCheckInPending==""){
			var textDataEmpty = '<tr clearTr="checkinpendingReservation" >'+
			'<td colspan="100%" style="text-align:center;" >'+
			dataEmpty+
			'</td>'+
			'</tr>';
			textRoomCheckInPending = textDataEmpty;
		}
		$("#CheckInListPendingRoomManageMent_Id_Tr").replaceWith("<tr id=CheckInListPendingRoomManageMent_Id_Tr ></tr>"+textRoomCheckInPending);
		textRoomCheckInPending = "";
		textSubRes = "";
		textPrint = textRoomCheckInPendingPrint;
	}
	dateRoomManageMent({checkin:"calendar_btw_checkinPendingCheckin",atrcheckin:"dateofBtwCheckinPendingCheckin"},{checkout:"calendar_btw_checkoutPendingCheckin",atrcheckout:"dateofBtwCheckoutPendingCheckin"});
	$(".ui-datepicker-trigger").css("margin-top","2px");
	closeWaitingDialog();
	
	showDataResRoomManageMentSetPagePendingCheckin(data,getCurrentTabData().linePendingCheckin);
}

function showDataResRoomManageMentSetPagePendingCheckin(data,output){
	$("[clearTr*=checkinpendingReservationPage]").remove();
	objArray = JSON.parse(data);
	objArray = objArray[1];
	var textRoomPendingCheckinSetpage = "";
	for(var i =0;i<objArray.length;i++){
		var textSubRes = "";
		if(objArray[i].groupId!="0"){
			var statusRecord = "";
			for(var subRes = 0;subRes<objArray[i].subList.length;subRes++){
				textSubRes += '<tr clearTr=checkinpendingReservationPage  ><td></td></tr>';
			}
			textRoomPendingCheckinSetpage += '<tr clearTr=checkinpendingReservationPage class="trPendingcheckin"><td></td></tr>'+textSubRes;
		}else{
			textRoomPendingCheckinSetpage += '<tr clearTr=checkinpendingReservationPage ><td></td></tr>';
		}
	}
	$("[name = CheckInListPendingRoomManageMent_Id_Tr2]").replaceWith("<tr name=CheckInListPendingRoomManageMent_Id_Tr2></tr>"+textRoomPendingCheckinSetpage);
	textRoomPendingCheckinSetpage = "";
	textSubRes = "";
	
	showPager(output);
}

function showDataResRoomManageMentSetCountPendingCheckin(data,output){
	var subCount = 0;
	var recCount = 0;
	var objArray = new Array();
	if((data=="textSearch"||data=="G"||data=="S"||data=="A"||data=="reservationType_A"||data=="Checked-out Rooms"||data=="Checked-in Rooms")&&data!="dateSearch"){
		objArray = oldObjArrayCheckin;
		objArrayCheck = objArray[0];
		objArray = objArray[1];
	}else{
		objArray = JSON.parse(data);
		oldObjArrayCheckin = objArray;
		objArrayCheck = objArray[0];
		objArray = objArray[1];
	}
	setRowObjArrayCheckin = objArray;
	sortIdRoommanagement(objArray);
	sortIdRoommanagement(objArrayCheck);
	for(var i =0;i<objArray.length;i++){
		if(objArray[i].groupId!="0"){
			if(objArray[i].subList!=undefined){
				if(objArrayCheck[objArrayCheck.length-1].groupId==objArray[i].groupId){
					recCount = (i+1);
					subCount = objArrayCheck[objArrayCheck.length-1].subList.length+1;
					break;
				}
			}else{
				if(objArrayCheck[objArrayCheck.length-1].groupId==objArray[i].groupId){
					recCount = (i+1);
					break;
				}
			}
		}else{
			if(objArrayCheck[objArrayCheck.length-1].id==objArray[i].id){
				recCount = (i+1);
				break;
			}
		}
	}
	getCurrentTabData().beforePagePendingCheckin = (recCount);
	getCurrentTabData().beforeSubPagePendingCheckin = subCount;
	simpleservice(getCurrentTabData().linkSet,null,showDataResRoomCheckinPendingManageMent,data);
}

function typeReservationPendingCheckinFunction(dataOld,offfset,pagePointer,dateCheckin,dateCheckout,data){
	
	if(dataOld=="G"){
		getCurrentTabData().typeReservationPendingCheckin = dataOld;
		if(pagePointer>1){
			var link = "/reservationService?func=getReservationAllCheckinPendingOnlyGroup&offset="+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			var linkSet = "/reservationService?func=getReservationAllCheckinPendingOnlyGroup&offset="+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			getCurrentTabData().linkSet = linkSet;
			simpleservice(link,null,showDataResRoomManageMentSetCountPendingCheckin,getCurrentTabData().linePendingCheckin);
		}else{
			getCurrentTabData().beforePagePendingCheckin = ""; 
			getCurrentTabData().beforeSubPagePendingCheckin = "";
			var link = "/reservationService?func=getReservationAllCheckinPendingOnlyGroup&offset="+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			simpleservice(link,null,showDataResRoomCheckinPendingManageMent,data);
		}
	}else if(dataOld=="S"){
		getCurrentTabData().typeReservationPendingCheckin = dataOld;
		if(pagePointer>1){
			var link = "/reservationService?func=getReservationAllCheckinPendingOnlySingle&offset="+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			var linkSet = "/reservationService?func=getReservationAllCheckinPendingOnlySingle&offset="+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			getCurrentTabData().linkSet = linkSet;
			simpleservice(link,null,showDataResRoomManageMentSetCountPendingCheckin,getCurrentTabData().linePendingCheckin);
		}else{
			getCurrentTabData().beforePagePendingCheckin = ""; 
			getCurrentTabData().beforeSubPagePendingCheckin = "";
			var link = "/reservationService?func=getReservationAllCheckinPendingOnlySingle&offset="+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			simpleservice(link,null,showDataResRoomCheckinPendingManageMent,data);
		}
	}else if(dataOld=="A"){
		getCurrentTabData().typeReservationPendingCheckin = dataOld;
		if(pagePointer>1){
			var link = "/reservationService?func=getReservationAllCheckinPendingOnly&offset="+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+(pagePointer-1)+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			var linkSet = "/reservationService?func=getReservationAllCheckinPendingOnly&offset="+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			getCurrentTabData().linkSet = linkSet;
			simpleservice(link,null,showDataResRoomManageMentSetCountPendingCheckin,getCurrentTabData().linePendingCheckin);
		}else{
			getCurrentTabData().beforePagePendingCheckin = ""; 
			getCurrentTabData().beforeSubPagePendingCheckin = "";
			var link = "/reservationService?func=getReservationAllCheckinPendingOnly&offset="+offfset+"&line="+getCurrentTabData().linePendingCheckin+"&pagePointer="+pagePointer+"&dateCheckin="+dateCheckin+"&dateCheckout="+dateCheckout;
			simpleservice(link,null,showDataResRoomCheckinPendingManageMent,data);
		}
	}
}
////////////////////////////////////////////////////////////////////////////////////